import { _decorator, Component, KeyCode, Node } from 'cc';
import { PlayerState } from './PlayerState';
import { StateDefine } from '../../Config';
const { ccclass, property } = _decorator;

@ccclass('PlayerAimSwordState')
export class PlayerAimSwordState extends PlayerState {
    onEnter() {
        super.onEnter();
    }
    onExit() {
        super.onExit()
    }
    update(deltaTime: number) {
        super.update(deltaTime);
        this.player.ZeroVelocity();
        if(!this.player.pressedKeys[KeyCode.KEY_L]){
            this.player.stateMgr.transit(StateDefine.ThrowSword);
        }
    }
    onDestory() { }

    canTransit(to: StateDefine): boolean {
        return true
    }
}


